import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import springIoc.test03.springbean.BeanClass;

public class signletontest {
    @Test
    public void test1() throws Exception {
        /**
         * signlet智慧实例化一个bean
         */
                ApplicationContext applicationContext =new ClassPathXmlApplicationContext("spring.xml");
        BeanClass singletontest1 = (BeanClass) applicationContext.getBean("test04");
        System.out.println(singletontest1);
        BeanClass singletontest2 = (BeanClass) applicationContext.getBean("test04");
        System.out.println(singletontest2);
    }

}
